import { Component } from 'react'
import { WebView } from '@tarojs/components';
import Taro, { getCurrentInstance } from '@/newTaro';
import './index.scss'

export default class Webview extends Component {
  componentWillMount() {
    const title = this.$instance.router.params.title;
    if (title) {
      Taro.setNavigationBarTitle({
        title: decodeURIComponent(title)
      });
    }
  }
	$instance = getCurrentInstance();
  render () {
    const url = decodeURIComponent(this.$instance.router.params.url);
    return (
      <WebView src={url} />
    )
  }
}
